<?php
/*
Template Name: PostsPage
*/

$cat = $wp_query->query_vars['pagename'];

$args = array('category' => get_catID_by_slug($cat));
$posts = get_posts($args);

?>
<?php get_header(); ?>
<div id="content" class="widecolumn"><?

if ( count($posts) ) :
	foreach ( $posts as $post )  { 
		setup_postdata($post);
		?>
		<div class="post" id="post-<?php the_ID(); ?>">
			<h2><?php the_title(); ?></h2>
			<div class="entry">
				<?php the_content('Read the rest of this entry &raquo;'); ?>
			</div>
		</div>
		<? 
	} 
else : 
	?>
	<h2 class="center">Not Found</h2>
	<p class="center">Sorry, but you are looking for something that isn't here.</p>
	<?php include (TEMPLATEPATH . "/searchform.php"); ?>
	<? 
endif; 
?>
<?php get_footer(); ?>
